package viroyal.com.base.activity.engineering;

import android.widget.ImageView;
import android.widget.ListView;

import com.suntiago.baseui.activity.base.AppDelegateBase;

import java.util.List;

import viroyal.com.base.R;
import viroyal.com.base.adapter.SchoolListAdapter;
import viroyal.com.base.net.entity.SchoolData;
import viroyal.com.dev.splash.ConfigDevice;

/**
 * @author gaochao
 */
public class EngineeringDelegate extends AppDelegateBase<EngineeringModel> {

  @Override
  public int getRootLayoutId() {
    return R.layout.activity_engineering;
  }

  @Override
  public void initWidget() {

  }

  public void initView() {
    ImageView ivBack = get(R.id.ic_back);
    ivBack.setOnClickListener(view -> getActivity().finish());
  }


  public String getDeviceUUID() {
    return ConfigDevice.getDeviceId();
  }

  public ListView updateListData(List<SchoolData> extra) {
    SchoolListAdapter adapter = new SchoolListAdapter(extra, rootView.getContext());
    ListView listView = get(R.id.lv_school_list);
    listView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
    return listView;
  }


}
